<%@page import="org.jeecgframework.web.util.StaticValue" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@include file="/context/mytags.jsp" %>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<div class="easyui-layout" fit="true">
    <div region="center" style="padding:1px;">
        <t:datagrid name="evaluateList" fitColumns="true" title="影院管理"
                    actionUrl="cbsInspectionEvaluateController.do?datagridOfHomePage&homePageType=${homePageType }" idField="id"
                    fit="true" queryMode="group" sortOrder="desc">
            <t:dgCol title="主键" field="id" hidden="true" width="120"/>
            <t:dgCol title="设备SN" field="sn" hidden="true" query="true" queryMode="single" width="120"/>
            <t:dgCol title="影院名称" field="cinemaName" query="true" queryMode="single" width="140" align="center"/>
            <t:dgCol title="巡检联系人" field="contactName"  queryMode="single" width="80" align="center"/>
            <t:dgCol title="电话" field="phone"  queryMode="single" width="80" align="center"/>
            <t:dgCol title="服务时间" field="actualDate" formatter="yyyy-MM-dd" width="120" align="center" queryMode="group" query="true"/>
            <t:dgCol title="服务类型" field="busType" dictionary="evaluate_bus_type" width="80" align="center" query="true"/>
            <t:dgCol title="服务单ID" field="planId" query="true" queryMode="single" width="80" url="cbsInspectionEvaluateController.do?detailsOfPlan&planId={planId}" funname="planDetails" align="center"/>
            <t:dgCol title="服务单位" field="departname" width="120" sortable="false"
                     align="center"/>
            <t:dgCol title="服务人" field="engineer" queryMode="single" width="80" sortable="false"
                     align="center"/>

            <%--<t:dgCol title="联系人"			field="inspection.zyCmIpCt.name"			width="120" />
            <t:dgCol title="联系电话"		field="inspection.zyCmIpCt.cellphone1"    dictionary="<%=StaticValue.DIC_TRUE_OR_FALSE_NUM %>" width="120" />
            --%>
            <t:dgCol title="评价状态" field="evaluateState" query="true" queryMode="single" dictionary="<%=StaticValue.DIC_EVALUATE_STATE %>"
                         defaultSelectVal="<%=StaticValue.DIC_EVALUATE_STATE_0 %>" width="120" align="center"/>
            <t:dgCol title="操作" field="opt" width="100" align="center"/>
            <t:dgToolBar title="评价" icon="icon-add" funname="goEvaluate" width="900" height="600"/>
            <t:dgFunOpt title="查看" funname="goView(id)" exp="evaluateState#eq#1"></t:dgFunOpt>
        </t:datagrid>
    </div>
</div>
<script type="text/javascript">
    $(function () {
        //给时间控件加上样式
        $("#evaluateListtb").find("input[name='actualDate_begin']").attr("class", "Wdate").attr("style", "height:20px;width:90px;").click(function () {
            WdatePicker({dateFmt: 'yyyy-MM-dd'});
        });
        $("#evaluateListtb").find("input[name='actualDate_end']").attr("class", "Wdate").attr("style", "height:20px;width:90px;").click(function () {
            WdatePicker({dateFmt: 'yyyy-MM-dd'});
        });
    });

    function planDetails(fName,url){
        addOneTab("计划详情",url);
    }
    function goView(id) {
        createdetailwindow('', 'inspectionWx.do?goPcEvaluateDetail&id=' + id,900,560);
    }
    function goEvaluate() {
        var datas = $("#evaluateList").datagrid("getSelections");
        if (datas.length != 1) {
            tip("请选择一项查看");
            return;
        }
        if(datas[0].evaluateState == '1'){
            tip("选择项已经评价过");
            return;
        }
        var id = datas[0].id;
        var busType = datas[0].busType;
        createwindow('', 'inspectionWx.do?goEvaluate&id=' + id+'&busType='+busType,900,540);
    }
    function importCinema() {
        createdetailwindow('基础数据导入', 'uploadCinemaController.do?uploadFile', 470, 150)
    }
</script>
